#include <stdio.h>
#include <string.h>
int main()
{
    char s[] = "192.168.120.10";

    char *p = strtok(s, ".");
    printf("p = %s\n", p);
    p = strtok(NULL, ".");
    printf("p = %s\n", p);
    p = strtok(NULL, ".");
    printf("p = %s\n", p);
    p = strtok(NULL, ".");
    printf("p = %s\n", p);
}